package com.yocard.yxyd.ui.activity;

import android.graphics.Color;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.widget.TextView;

import com.gyf.barlibrary.ImmersionBar;
import com.yocard.yxyd.R;
import com.yocard.yxyd.ui.activity.base.SimpleActivity;
import com.yocard.yxyd.utils.util.ActivityUtils;
import com.yocard.yxyd.utils.util.AppUtils;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created on 2019/4/22.
 */
public class AboutUsActivity extends SimpleActivity {

    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_version)
    TextView tvVersion;
    @BindView(R.id.tv_desc)
    TextView tvDesc;
    @BindView(R.id.tv_desc2)
    TextView tvDesc2;

    @Override
    protected int getLayout() {
        return R.layout.act_about_us;
    }

    @Override
    protected void initEventAndData() {
        initTitle();
        SpannableStringBuilder span = new SpannableStringBuilder(tvDesc.getText());
        span.setSpan(new ForegroundColorSpan(Color.TRANSPARENT), 0, 2,
                Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
        tvDesc.setText(span);
        tvVersion.setText(getString(R.string.version_prefix) + AppUtils.getAppVersionName());
    }

    private void initTitle() {
        ImmersionBar.with(this).statusBarColor(R.color.white)
                .statusBarDarkFont(true).navigationBarColor(R.color.white).init();
        tvTitle.setText(R.string.about_us);
    }

    @OnClick({R.id.iv_back})
    public void onClick() {
        ActivityUtils.finishActivity(this);
    }

}
